<template>
  <div class="bar" style="background-color: #26a2ff">
    <a v-if="!!closeBack" class="button back-button buttons button-clear header-item" @click="goBack($event)">
      <i class="iconfont icon-back-outline" style="color: white"></i>
    </a>
    <h1 class="title" style="color: white">{{ title }}</h1>
    <div class="buttons buttons-right">
    </div>
  </div>
</template>

<script>
  export default {
    props: {
      title: {
        type: String,
        default: '标题'
      },
      closeBack: {
        default: 0
      },
      showBar: {
        default: 1
      },
      showMessage: {
        default: 0
      }
    },
    methods: {
      goBack(e) {
        if (window.history.length > 1) {
          e.preventDefault();
          window.history.back();
          return false;
        }
        return true;
      }
    }
  };
</script>
<style lang="scss">
@import '../styles/mixins/mixin';
@import '../styles/variables/variables';
  .bar {
    display: flex;
  }
</style>
